syncRootDirectory

fun syncRootDirectory(rootDir: String): AppConfiguration.Builder

Configures the root folder that marks the location of a mongodb-realm folder. This folder contains all files and realms used when synchronizing data between the device and MongoDB Realm.

The default root directory is platform-dependent:

// For Android the default directory is obtained using
val dir = "${Context.getFilesDir()}"

// For JVM platforms the default directory is obtained using
val dir = "${System.getProperty("user.dir")}"

// For macOS the default directory is obtained using
val dir = "${NSFileManager.defaultManager.currentDirectoryPath}"

// For iOS the default directory is obtained using
val dir = "${NSFileManager.defaultManager.URLForDirectory(
NSDocumentDirectory,
NSUserDomainMask,
null,
true,
null
)}"

Parameters

rootDir

the directory where a mongodb-realm directory will be created.